﻿<%@ Page Language="C#" title="项目级评判终选" MasterPageFile="~/W_View/PageMaster.Master" CodeBehind="ProjrecomPage.aspx.cs" Inherits="STHPMS1.Web.W_View.Decision.Preventive.ProjrecomPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/datagrid.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/dropdown.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/Jquery/ajaxfileupload.js")%>

    <script type="text/javascript">

        function B_RoadwayEdit(flag) {
            var row = $('#dg').datagrid('getSelected');
            var title = "";
            if (flag == 0) {
                if (!row) {
                    $.messager.alert('消息提示', '编辑数据时，请选择一项!', 'warning');
                    return;
                }
                $('#fm').form('load', row);
                title = "新增测试数据";
            }
            else {
                $('#fm').form('clear');
                title = "编辑测试数据";
            }

            $('#dlg').dialog('open');
        }

       

        //自动选取终选措施
        function SetZX() {
            var anniname = $('#cmbAnniName').combobox("getValue");
            var analy_year = $('#cmbAnaly_Year').combobox("getValue");
            if (!anniname && !analy_year) {
                $.messager.alert('消息提示', '请选择资金模型名称和分析年度！', 'warning');
                return;
            }

            $.ajax({
                url: "/api/projrecom/setzxvalue?anniname=" + anniname + "&analy_year=" + analy_year + "",
                type: "GET",
                success: function () {
                    $.messager.alert('成功', '自动选取终选措施!', "info");
                    $('#dg').datagrid({ url: '/api/projrecom', pageNumber: 1 });
                },
                error: function (err) {
                    $.messager.alert('错误提示', '自动选取终选措施失败 -' + err, "error");
                }
            });
        }


        ///计算综合评判系数
        function SetCoef()
        {
            var anniname = $('#cmbAnniName').combobox("getValue");
            var analy_year = $('#cmbAnaly_Year').combobox("getValue");
            if (!anniname && !analy_year) {
                $.messager.alert('消息提示', '请选择资金模型名称和分析年度！', 'warning');
                return;
            }

            $.ajax({
                url: "/api/projrecom/setcoef?anniname=" + anniname + "&analy_year=" + analy_year + "",
                type: "GET",
                success: function () {
                    $.messager.alert('成功', '计算综合评判系数!', "info");
                    $('#dg').datagrid({ url: '/api/projrecom', pageNumber: 1 });
                },
                error: function (err) {
                    $.messager.alert('错误提示', '计算综合评判系数失败 -' + err, "error");
                }
            });
        }


        function search(n, o) {
            var anniname = $('#cmbAnniName').combobox("getValue");
            var analy_year = $('#cmbAnaly_Year').combobox("getValue");

            var url = '/api/projrecom';
            var urlParam = "";
            if (anniname != "" && anniname != "0") urlParam += "anniname=" + encodeURI(anniname) + "&";
            if (analy_year != "" && analy_year != "0") urlParam += "analy_year=" + encodeURI(analy_year) + "&";
            if (urlParam != "") {
                urlParam = "?" + urlParam.substring(0, urlParam.length - 1);
                url = url + urlParam;
            }
            $('#dg').datagrid({ url: url, pageNumber: 1 });
        }


        $(function () {
            var number = '<%= Page.RouteData.Values["page"] %>';
            var size = '<%= Page.RouteData.Values["size"] %>';

            loadAdmDiv();
            dataGridBind($('#dg'), '/api/projrecom', '终选', $('#tb'), number, size);

            $('.validatebox-text').bind('blur', function () {
                $(this).validatebox('enableValidation').validatebox('validate');
            });
        })

    </script>    

    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table id="dg" class="easyui-datagrid content-place"  ajaxCached="false"  >
        <thead>
            <th data-options="field:'Analy_Year',editor:'text',width:100,align:'right' ">分析年度</th>
            <th data-options="field:'Rdwayid',editor:'text',width:80,align:'right' ">路线编号</th>
            <th data-options="field:'Mainsegid',editor:'text',width:300,align:'right' ">养护路段</th>
            <th data-options="field:'Meas_Ini',editor:'numberbox',width:150,align:'right' " >复选措施</th>
            <th data-options="field:'Judge_Coef',editor:'numberbox',width:80,align:'right' " >综合评判系数</th>
            <th data-options="field:'Preven_Measure',editor:'text',width:150,align:'right' " formatter="formatYesNoType">预防性养护措施 </th>
          

        </thead>
    </table>
   
    <div id="tb">
        <%-- <select id="cmbRoads" class="easyui-combobox" panelHeight="80" style="width:100px" data-options="prompt:'路线编号',url:'/api/roadway/dict',method:'get',valueField:'id',textField:'id',onChange:search">
         </select>--%>

       <%-- <select id="cmbRoadnetId" class="easyui-combobox" panelHeight="80" style="width:100px" data-options="prompt:'路网名称',url:'/api/roadnet/getroadnet',method:'get',valueField:'id',textField:'text'">
         </select>--%>

         <select id="cmbAnniName" class="easyui-combobox" panelHeight="80" style="width:100px" data-options="prompt:'资金模型名称',url:'/api/dfcostmodpara/anniname',method:'get',valueField:'id',textField:'id'">
         </select>

        <select id="cmbAnaly_Year" class="easyui-combobox" name="cmbAnaly_Year" data-options="prompt:'分析年度',onChange:search" style="width:100px;">   
            <option value="2015">2015年</option>   
            <option value="2016">2016年</option>   
            <option value="2017">2017年</option>   
            <option value="2018">2018年</option>   
            <option value="2019">2019年</option>   
        </select>  
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="B_RoadwayEdit(0)">自定义权重和分值</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="SetCoef()">计算综合评判系数</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="SetZX()">自动选取终选措施</a>
        <%--<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="B_RoadwayDel()">下一步效益费用分析</a>
        --%>
     
    </div>


    
    <div id="dlg" class="easyui-dialog" title="自定义权重和分值" style="width:700px;height:600px;padding:10px" closed="true"  data-options="
				iconCls: 'icon-save',
				buttons: '#dlg-buttons'">
        <form id="fm" method="post" action="/api/projrecom">
            <table>		
               <%--  <tr style="display:none">
                    <td>ID:</td>
                    <td colspan="2"><input name='Id' class='easyui-validatebox easyui-textbox'  /></td>
                </tr>	     --%>
                <tr>
                    <td>路线编号:</td>
                    <td colspan="2"><input id="Rdwayid" name='Rdwayid' class='easyui-validatebox  easyui-textbox'  data-options="readonly:true"/></td>
                </tr>
                <tr>
                    <td>复选措施:</td>
                    <td colspan="2"><input name='Meas_Ini' class='easyui-combobox'  data-options="prompt:'复选措施',url:'/api/projrecom/measini?rdwayid='+$('#Rdwayid').val()+'',method:'get',valueField:'id',textField:'text'"/></td>
                </tr>

                <tr>
                    <td></td>
                    <td>权重</td>
                    <td>分值</td>

                </tr>

                 <tr>
                    <td>可获得的材料:</td>
                    <td><input id="CL_Coe" name='CL_Coe'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:100,precision:2"/></td>
                    <td><input id="CL_Value" name='CL_Value'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:5,precision:2"/></td>
                </tr>
                <tr>
                    <td>施工质量:</td>
                    <td><input name='ZL_Coe' class='easyui-validatebox easyui-numberbox' data-options="required:true,min:0,max:100,precision:2" /></td>
                    <td><input name='ZL_Value' class='easyui-validatebox easyui-numberbox' data-options="required:true,min:0,max:5,precision:2" /></td>
                </tr>
                <tr>
                    <td>耐久性:</td>
                    <td><input name='NJX_Coe' class='easyui-validatebox easyui-numberbox' data-options="required:true,min:0,max:100,precision:2"/></td>
                    <td><input name='NJX_Value' class='easyui-validatebox easyui-numberbox' data-options="required:true,min:0,max:5,precision:2"/></td>
                </tr>
                <tr>
                    <td>交通干扰:</td>                    
	                <td><input name='GY_Coe'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:100,precision:2"  /></td>
                    <td><input name='GY_Value'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:5,precision:2"  /></td>
                </tr>
                <tr>
                    <td>行驶舒适性:</td>                    
	                <td><input name='SSX_Coe'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:100,precision:2"  /></td>
                    <td><input name='SSX_Value'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:5,precision:2"  /></td>
                </tr>
                <tr>
                    <td>抗滑性:</td>                    
	                <td><input name='KHX_Coe'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:100,precision:2"  /></td>
                    <td><input name='KHX_Value'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:5,precision:2"  /></td>
                </tr>
                <tr>
                    <td>噪音:</td>                    
	                <td><input name='ZY_Coe'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:100,precision:2"  /></td>
                    <td><input name='ZY_Value'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:5,precision:2"  /></td>

                </tr>
                <tr>
                    <td>美观:</td>                    
	                <td><input name='MG_Coe'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:100,precision:2"  /></td>
                    <td><input name='MG_Value'  class="easyui-validatebox easyui-numberbox" data-options="required:true,min:0,max:5,precision:2"  /></td>
                </tr>

		    </table>
            【自定义权重和分值】说明：</br>
            （1）	权重填写说明：</br>
                    根据当地实际情况对各项属性进行权重分配，各项权重之和为100；</br>
            （2）	分值填写说明：</br>
                    根据当地实际情况对各项属性进行分值分配，每项分值范围为0~5。各项属性的含义及分值含义如下：</br>
                    a.获得符合质量要求材料的难易程度（5=很容易，1=很难）；</br>
                    b.施工单位的数量度和经验（5=质量很好，1=质量很差）；</br>
                    c.预防性养护措施的使用寿命（5=最长，1=最短）；</br>
                    d.对交通干扰程度（5=几乎没有干扰，1=干扰很大）；</br>
                    e.平整度的改善（5=改善很好，1=没有改善）；</br>
                    f.对抗滑性的改善（5=改善很好，1=没有改善）；</br>
                    g.噪声（5=明显减少，1=明显增加）；</br>
                    h.外观改善（5=改善很大，1=没有改善）。</br>


        </form>
    </div>

     <div id="dlg-buttons">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:sumbitData($('#dg'),$('#dlg'))">保存</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:$('#dlg').dialog('close')">取消</a>
	</div>

    

    
</asp:Content>

